<template>
    <div class="buttons">
        <img
            v-if="row.buttonState.addendumState"
            @click="toRouter('tenderAddendumAdd', row.billId)"
            src="@/assets/bidding/addendum.png"
            title="补遗"
        />
        <img
            v-if="row.buttonState.closeState"
            @click="toRouter('bidClosingAdd', row.billId)"
            src="@/assets/bidding/close.png"
            title="关闭"
        />
        <img
            v-if="row.buttonState.resultRegisterState"
            @click="toRouter('bidEvaluationResultAdd', row.billId)"
            src="@/assets/bidding/resultRegister.png"
            title="评标结果"
        />
        <!-- <span
            v-if="row.buttonState.resultPublicityState"
            @click="toRouter('biddingResultAdd', row.billId)"
            >结果公示</span
        > -->
        <!-- <span
            v-if="row.buttonState.noticeState"
            @click="toRouter('bidWinningNoticeAdd', row.billId)"
            >中标通知</span
        > -->
        <!-- <span
            type="primary"
            class="btn-blue"
            size="small"
            v-if="row.buttonState.applyReleaseState && row.buttonState.releaseState"
            @click="release"
            >发布</span
        > -->
        <!-- <el-popover
            placement="top-start"
            width="200"
            trigger="click"
            :content="biddingRegUrl"
            v-if="row.buttonState.applySignUpState"
        >
            <span slot="reference" type="primary" class="btn-blue" size="small" @click="biddingReg"
                >招标报名地址</span
            >
        </el-popover> -->
    </div>
</template>

<script>
export default {
    props: {
        row: {
            type: Object,
            default: function () {
                return {}
            }
        },
        api: {
            type: String,
            default: 'default' //工程施工招标
        }
    },
    data () {
        return {}
    },
    created () {
        // console.log('row', this.row)
    },
    methods: {
        toRouter (path, tenderId) {
            if (this.api !== 'default') {
                // 首字母转大写
                const characters = [...path]
                characters[0] = characters[0].toUpperCase()
                path = characters.join('')
            }
            if (this.api === 'default') {
                this.$router.push({
                    path,
                    query: { tenderId }
                })
            } else if (this.api === 'engineeringOther') {
                path = 'other' + path
                this.$router.push({
                    path,
                    query: { tenderId }
                })
            } else if (this.api === 'materialBidding') {
                path = 'material' + path
                this.$router.push({
                    path,
                    query: { tenderId }
                })
            } else if (this.api === 'hireBidding') {
                path = 'hire' + path
                this.$router.push({
                    path,
                    query: { tenderId }
                })
            } else if (this.api === 'serviceBidding') {
                path = 'service' + path
                this.$router.push({
                    path,
                    query: { tenderId }
                })
            } else if (this.api === 'equipmentBidding') {
                path = 'equipment' + path
                this.$router.push({
                    path,
                    query: { tenderId }
                })
            } else if (this.api === 'equipHireBidding') {
                path = 'equipHire' + path
                this.$router.push({
                    path,
                    query: { tenderId }
                })
            } else if (this.api === 'machineBidding') {
                path = 'machine' + path
                this.$router.push({
                    path,
                    query: { tenderId }
                })
            }
        }
    }
}
</script>

<style lang="scss" scoped>
.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    img {
        padding: 0 4px;
    }
}
</style>
